-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: return all connected peers from REST API #2923
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but it is not working this way. We have a API response structure we must confirm with. So we return peers with their supported protocols.
This issue here - I think - that we won't return peers with protocol if the same protocol we don't support. (we = the node queried by GET /admin/peers). I think we should return all peers are connected and list all the protocols they support.
Also to mention this API endpoint has got no influence on how real connections are made, it is simply just a view of the current peer store.
Also there is the POST /admin/peers where we can inject new relay peers for the node.
… req/resp protocols.
You can find the image built from this PR at
Built from d763cd5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Maybe we should add a test case for this?
…nnected peer by GET /admin/peers
Yepp, done! |
Description
Currently GET
/admin/v1/peers
has additional logic to build a list of peers service node is connected to.It does go through each group of protocols and builds a list:
nwaku/waku/waku_api/rest/admin/handlers.nim
Line 43 in 6d385ce
We can directly return list of connected peers as it more aligned with description of the endpoint: